<div class="g-col g-col-2">
  <h2 class="b-sub-headline"><?= $title ?></h2>
  <div class="par parsys">
    <?php if ($product_video) { ?>
      <div class="detail-video">
        <video id="detail_video_1" class="video-js vjs-default-skin vjs-big-play-centered gu-media--video" controls
               preload="auto"
               poster="" data-setup="{}">
          <source src="<?= $product_video ?>" type='video/mp4'/>
          <p class="vjs-no-js">
            To view this video please enable JavaScript, and consider upgrading to a web browser that
            <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
          </p>
        </video>
      </div>
    <?php } ?>
    <?php if (isset($product_content) && !empty($product_content)) { ?>
      <div class="textimage">
        <div class="mod mod-text-image skin-text-only clearfix">
          <div class="mod mod-media-lightbox">
            <div class="content rich">
              <?= $product_content[0] ?>
            </div>
          </div>
        </div>
      </div>
    <?php } ?>
    <div class="accordion">
      <div class="mod mod-accordion ">
        <div class="parsys accordionItems">
          <?php
          if (isset($product_tab_list) && !empty($product_tab_list)) {
            foreach ($product_tab_list as $tab_k => $tab_value) {
              if (!empty($tab_value['field_product_tab_title'])) {
                ?>
                <div class="item">
                  <div class="accordion-element-wrapper ">
                    <section class="accordion-element js-accordion-element ga-accordion <?= $tab_value['field_product_tab_down'] == 1 || $tab_k == 0 ? 'active' : '' ?> ">
                      <a href="javascript:;" class="accordion-link js-accordion-link">
                        <h3 class="headline">
                          <?= $tab_value['field_product_tab_title'] ?>
                          <i class="icon-arrow-down"></i>
                        </h3>
                      </a>
                      <div class="accordion-content js-accordion-content ">
                        <div class="parsys">
                          <?php
                          if (isset($tab_value['field_product_tab_video']) && !empty($tab_value['field_product_tab_video'])) {
                            ?>
                            <div class="detail-video">
                              <video id="detail_video_1"
                                     class="video-js vjs-default-skin vjs-big-play-centered gu-media--video"
                                     controls
                                     preload="auto"
                                     poster="" data-setup="{}">
                                <source src="<?= url($tab_value['field_product_tab_video']) ?>"
                                        type='video/mp4'/>
                                <p class="vjs-no-js">
                                  To view this video please enable JavaScript, and
                                  consider upgrading to a web browser that
                                  <a href="http://videojs.com/html5-video-support/"
                                     target="_blank">supports HTML5 video</a>
                                </p>
                              </video>
                            </div>
                            <?php
                          }
                          ?>
                          <?php
                          if (isset($tab_value['field_product_tab_content']) && !empty($tab_value['field_product_tab_content'])) {
                            ?>
                            <div class="textimage">
                              <div class="mod mod-text-image skin-text-only clearfix">
                                <div
                                  class="mod mod-text-image skin-text-only clearfix">
                                  <div class="content rich">
                                    <?= $tab_value['field_product_tab_content'][0] ?>
                                  </div>
                                </div>
                              </div>
                            </div>
                            <?php
                          }
                          ?>
                          <?php
                          if (isset($tab_value['product_tab_tab_list']) && !empty($tab_value['product_tab_tab_list'])) {
                            foreach ($tab_value['product_tab_tab_list'] as $tab_tab_k => $tab_tab_value) {
                              ?>
                              <div class="mediagallery">
                                <section class="mod mod-mediagallery clearfix">
                                  <div class="mod mod-text-image">
                                    <div class="image">
                                      <?php if ($tab_value['field_product_tab_image_show_type'] != 1) { ?>
                                        <a class="flyoutcarousel iframe"
                                           href="#mediagallery-<?= $tab_tab_k ?>-<?= $tab_tab_value['item_id'] ?>">
                                          <img
                                            src="<?= check_file_is_image($tab_tab_value['field_product_tab_tab_image_video'][0]['url']) ? $tab_tab_value['field_product_tab_tab_image_video'][0]['url'] : $tab_tab_value['field_product_tab_tab_image_video'][0]['thumb']; ?>">
                                          <span class="image_icon-search icon-search"></span>
                                        </a>
                                        <?php
                                      }
                                      else { ?>
                                        <img
                                          src="<?= check_file_is_image($tab_tab_value['field_product_tab_tab_image_video'][0]['url']) ? $tab_tab_value['field_product_tab_tab_image_video'][0]['url'] : $tab_tab_value['field_product_tab_tab_image_video'][0]['thumb']; ?>">
                                      <?php } ?>
                                    </div>
                                    <div class="mod mod-media-lightbox">
                                      <div class="content rich">
                                        <!-- 标题 -->
                                        <?php if (isset($tab_tab_value['field_product_tab_tab_title']) && !empty($tab_tab_value['field_product_tab_tab_title'])) {
                                          ?>
                                          <h3><?= $tab_tab_value['field_product_tab_tab_title'] ?></h3>
                                          <?php
                                        }
                                        ?>
                                        <!-- 描述 -->
                                        <?php if (isset($tab_tab_value['field_product_tab_tab_content']) && !empty($tab_tab_value['field_product_tab_tab_content'])) {
                                          ?>
                                          <?= $tab_tab_value['field_product_tab_tab_content'] ?>
                                          <?php
                                        }
                                        ?>
                                        <!-- 附件 -->
                                        <?php if (isset($tab_tab_value['field_product_tab_tab_file']) && !empty($tab_tab_value['field_product_tab_tab_file'])) {
                                          ?>
                                          <p>
                                            <i class="filetype-icon-pdf"></i>
                                            <a class="b ga-pdf-download"
                                               href="<?= user_is_logged_in() ? $tab_tab_value['field_product_tab_tab_file'] : url('user/login',array('query' => array('destination' => request_path()))) ?>"
                                              <?= user_is_logged_in() ? 'target="_blank"' : ''?>>查看详情</a>
                                            (PDF,
                                            <?= $tab_tab_value['field_product_tab_tab_filesize'] ?>
                                            B)
                                          </p>
                                          <?php
                                        }
                                        ?>
                                      </div>
                                    </div>
                                    <div class="galleria-wrap">
                                      <div class="mod mod-mediagallery clearfix"
                                           id="mediagallery-<?= $tab_tab_k ?>-<?= $tab_tab_value['item_id'] ?>">
                                        <div class="galleria lightbox">
                                          <?php foreach ($tab_tab_value['field_product_tab_tab_image_video'] as $v) { ?>
                                            <a href="<?= $v['url'] ?>">
                                              <img src="<?= check_file_is_image($v['url']) ? $v['url'] : $v['thumb'] ?>"
                                                   alt="<?= $v['content'] ?>"
                                                   data-description="<?= $v['content'] ?>"
                                                   class="<?= check_file_is_image($v['url']) ? '' : 'iframe' ?> thumb">
                                            </a>
                                            <?php
                                          }
                                          ?>

                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </section>
                              </div>
                              <?php
                            }
                          }
                          ?>

                        </div>
                      </div>
                    </section>
                  </div>
                </div>
                <?php
              }
            }
          }
          ?>
        </div>
      </div>
    </div>
  </div>
</div>